import java.util.*;
class Main {
    public static StringBuffer ten_to_k(int m,int p) {
        StringBuffer str = new StringBuffer();
        while(m > 0) {
            str.append(trans(m,p));
            m /= p;
        }
        str.reverse();
        return str;
    }

    public static String trans(int a,int p) {
        if (a % p < 10) {
            return a % p + "";
        } else {
            return ((char)(a % p - 10 + 65)) + "";
        }
    }

    public static void main (String[] args) {
        Scanner in = new Scanner(System.in);
        int p = in.nextInt();
        for(int i = 1;i < p;i ++) {
            for(int j = 1;j <= i;j ++){
                System.out.print(ten_to_k(i,p) + "*" + ten_to_k(j,p) + "=" + ten_to_k(i*j,p) + " ");
            }
            System.out.println();
        }
    }
}
